<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div id="view-text"></div>
<script>
    let xhr = new XMLHttpRequest();
    xhr.onreadystatechange = function (args) {
        console.log(args, this.readyState)
        // console.log(xhr.getAllResponseHeaders())
        if (xhr.readyState === 4 && xhr.status === 200) {
            document.getElementById("view-text").innerText = xhr.responseText
        }
    }
    xhr.open('POST', 'http://localhost:81/template/test2/hello')
    // void open（method，URL，async，userName，password）
    xhr.setRequestHeader("token", "1111111111111111111")
    xhr.send(JSON.stringify({
        "test":"test-value"
    }))
</script>
</body>
</html>